{% extends "base.html" %}
{% block title %}Databases list{% endblock %}
{% block list %}
<br>
{% if message %}
    {% if status %}
    <p class="error">Operation Success! {{ message }}</p>
    {% else %}
    <p class="error">Operation Failed! {{ message }}</p>
    {% endif %}
{% endif %}
<h2>Databases</h2>
<table width="100%">
<tr>
    <th>host</th>
    <th>database</th>
    <th>username</th>
    <th>password</th>
    <th>action</th>
    <th>delete</th>
</tr>
{% for database in databases_list %}
<tr>
  <td>{{ database.host }}</td>
  <td>{{ database.name }}</td>
  <td>{{ database.username }}</td>
  <td>{{ database.password }}</td>
  <td><a href="{{ database.id }}/generate">regenerate</a></td>
  <td><form action="{{ database.id }}/delete" method="post"><input type="submit" value="Delete"></form></td>
</tr>
{% endfor %}
</table>
<br>
{% endblock %}
{% block actions %}
    <form action="add" method=POST>
        {{ form.name }}
        <input type="submit" name="adddatabase" value="Add Database">
    </form>
{% endblock %}
